import { system as http } from '@zh/common-utils/http'

export { http }

/**
 * 查询列表
 * @param {Object} params
 */
export function getHelpList (params) {
  return http.post('/system/help/page', params)
}

/**
 * 删除/批量删除
 * @param {String} id
 */
export function deleteHelpInfo (id) {
  return http.post(`/system/help/delete?id=${id}`)
}

/**
 * 修改或保存
 * @param {Object} params
 */
export function saveOrUpdateHelpInfo (data) {
  const url1 = '/system/help/save'
  const url2 = '/system/help/update'
  return http.post(data.id ? url2 : url1, data)
}

/**
 * 根据id返回信息
 * @param {String} id
 */
export function getHelpInfoById (url) {
  return http.get(`/system/help/get?url=${url}`)
}